# Makefile for compiling the Serial Spectral Code Version 2.1 
# This uses the Intel Fortran Compiler, with FFTW 
# ---------------------------------------------------------------------
include compile
##---------------------------------------------------------------------
OBJ_rk =  2dflurk.o global2drk.o iniconf2d.o immersed_boundary.o energy2d.o rk2.o \
           eval_jac.o getpsivel.o real_diagnos.o fourier_diagnos.o fft.o openmp.o technical.o \
	   general.o forcing.o
MOD_FILE= mod_2dflu.o
MOD_FILE1= mod_part_interp.o
MOD_FILE2= mod_read_write.o
# -------------------------------------------------------------
default:$(OBJ_rk) $(MOD_FILE) $(MOD_FILE1) $(MOD_FILE2) 
	$(compile) $(OBJ_rk) $(MOD_FILE) $(MOD_FILE1) $(MOD_FILE2) -o nsrk_part.exe $(link)
nsrk_part.exe:$(OBJ_rk) $(MOD_FILE) $(MOD_FILE1) $(MOD_FILE2) 
	$(compile) $(OBJ_rk) $(MOD_FILE) $(MOD_FILE1) $(MOD_FILE2)   -o nsrk_part.exe $(link)
#
2dflurk.o: 2dflurk.f90 $(MOD_FILE) $(MOD_FILE1) $(MOD_FILE2) fft.o openmp.o technical.o immersed_boundary.o forcing.o 
	$(compile) -c 2dflurk.f90 $(MOD_FILE) $(MOD_FILE1) $(MOD_FILE2) fft.o openmp.o technical.o immersed_boundary.o forcing.o
#         
global2drk.o: global2drk.f90 $(MOD_FILE) 
	$(compile) -c global2drk.f90 $(MOD_FILE) 
#         
technical.o: technical.f90  
	$(compile) -c technical.f90  
#         
openmp.o: openmp.f90 $(MOD_FILE) 
	$(compile) -c openmp.f90 $(MOD_FILE) 
#
iniconf2d.o: iniconf2d.f90 $(MOD_FILE) 
	$(compile) -c iniconf2d.f90 $(MOD_FILE) 
#
gen_force.o: gen_force.f90 $(MOD_FILE) 
	$(compile) -c gen_force.f90 $(MOD_FILE)
#         
energy2d.o: energy2d.f90 $(MOD_FILE) 
	$(compile) -c energy2d.f90 $(MOD_FILE) 
#         
eval_jac.o: eval_jac.f90 $(MOD_FILE) $(MOD_FILE1) real_diagnos.o fourier_diagnos.o 
	$(compile)   -c   eval_jac.f90 $(MOD_FILE) $(MOD_FILE1) real_diagnos.o fourier_diagnos.o
#
apply_pbc.o: apply_pbc.f90 $(MOD_FIlE) 
	$(compile) -c apply_pbc.f90 $(MOD_FILE)
#         
rk2.o: rk2.f90  $(MOD_FILE) openmp.o forcing.o 
	$(compile) -c rk2.f90 $(MOD_FILE)  openmp.o forcing.o
#       
getpsivel.o: getpsivel.f90 $(MOD_FILE)
	$(compile) -c getpsivel.f90 $(MOD_FILE)
#       
get_Gradu.o: get_Gradu.f90 $(MOD_FILE)
	$(compile) -c get_Gradu.f90 $(MOD_FILE)
#       
real_diagnos.o: real_diagnos.f90 $(MOD_FILE)
	$(compile) -c real_diagnos.f90 $(MOD_FILE)
#       
fourier_diagnos.o: fourier_diagnos.f90 $(MOD_FILE)
	$(compile) -c fourier_diagnos.f90 $(MOD_FILE)
#
fft.o: fft.f90  technical.o openmp.o
	$(compile) -c fft.f90 technical.o openmp.o 
#
#plot_cont.o: plot_cont.f 
#		$(compile) -c plot_cont.f
#
mod_2dflu.o:  mod_2dflu.f90 technical.o 
	$(compile) -c mod_2dflu.f90 technical.o
mod_part_interp.o:  mod_part_interp.f90 openmp.o technical.o general.o 
	$(compile) -c mod_part_interp.f90 openmp.o technical.o general.o
mod_read_write.o:  mod_read_write.f90 
	$(compile) -c mod_read_write.f90
immersed_boundary.o:  immersed_boundary.f90 openmp.o general.o mod_2dflu.o 
	$(compile) -c immersed_boundary.f90 openmp.o general.o mod_2dflu.o
forcing.o:  forcing.f90 openmp.o general.o mod_2dflu.o 
	$(compile) -c forcing.f90 openmp.o general.o mod_2dflu.o
general.o:  general.f90 openmp.o 
	$(compile) -c general.f90 openmp.o
# ------------------------------------------------------------------------ 
clean:
	rm -f *.o *.mod core *.cmp.f90 *.kmo work.* *.d
total_clean:
	rm -f *.o *.mod core *.exe 
run_clean:
	rm -f -R spectras/* tau*/* data/* data_psi/* *.o *.mod core *.exe *.out *.core
## --------------------------------------------------------------------##  
